package cn.devil.two.reportFormStatistics

import cn.devil.two.utils.{CheckArguments, SCUtiles}
import org.apache.spark.SparkContext
import org.apache.spark.sql.DataFrame

object mediaAnalysis {
  def main(args: Array[String]): Unit = {
    CheckArguments(args,1,"请输入读取数据的文件",this.getClass)
    val Array(inputFilePath) = args
    val sc: SparkContext = SCUtiles.createSparkContextInstance("业务逻辑")
    val sqlContext = SCUtiles.createSQLContextInstance(sc)
    val frame: DataFrame = sqlContext.read.parquet(inputFilePath)
    frame.map(f=>{
      var appName = f.getAs[String]("appname")
      val appId = f.getAs[String]("appid")
      if(appName.isEmpty){
        appId
      }


      ((appName))
    })
  }
}
